//
//  ZGSCartoonCell.m
//  MapleLeaf
//
//  Created by dllo on 15/11/30.
//  Copyright © 2015年 AntennaBabyTeam. All rights reserved.
//

#import "ZGSCartoonCell.h"

@implementation ZGSCartoonCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatView];
    }
    return self;
}



- (void)creatView {
    self.picView = [[UIImageView alloc] init];
    [self.contentView addSubview:self.picView];
    
    self.titleLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.titleLabel];

    
    self.authorLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.authorLabel];
    self.authorLabel.font = [UIFont systemFontOfSize:14];
    
    self.totalLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.totalLabel];
    self.totalLabel.font = [UIFont systemFontOfSize:14];
    
    self.popularLabel = [[UILabel alloc] init];
    [self.contentView addSubview:self.popularLabel];
    self.popularLabel.font = [UIFont systemFontOfSize:14];
    
    self.lineView = [[UIView alloc] init];
    self.lineView.layer.borderColor = [[UIColor colorWithRed:0.871f green:0.871f blue:0.871f alpha:1.00f] CGColor];
    self.lineView.layer.borderWidth = 1;
    [self.contentView addSubview:self.lineView];
}



- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.picView.frame = CGRectMake(10, 8, WIDTH / 4.3, HEIGHT / 5.1 - 16);
    self.titleLabel.frame = CGRectMake(WIDTH / 4.3 + 20, HEIGHT / 51.0, 200, HEIGHT / 5.1 / 4);
    self.authorLabel.frame = CGRectMake(WIDTH / 4.3 + 20, HEIGHT / 5.1 / 2.3, 150, HEIGHT / 5.1 / 7);
    self.totalLabel.frame = CGRectMake(WIDTH / 4.3 + 20, HEIGHT / 5.1 / 3 * 2, 150, HEIGHT / 5.1 / 7);
    self.popularLabel.frame = CGRectMake(WIDTH - 80, HEIGHT / 5.1 / 3 * 2, 70, HEIGHT / 5.1 / 7);
    self.lineView.frame = CGRectMake(0, HEIGHT / 5.0 - 1, WIDTH, 1);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
